using System;
using System.Diagnostics;
using System.Globalization;
using System.Windows.Data;

namespace MSDNWebcast.Converter
{
    public class HalfWidthConberter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            Debug.Assert(value is double, "value should be a double");
            Debug.Assert(targetType.IsAssignableFrom(typeof (double)), "value should be a Rect");
            return (double) value/2;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}